Всем доброго времени суток! Есть ajax запрос который передает данные в php скрипт, php обрабатывает, и возвращает результат при помощи die() в div блок. Вопрос в том, есть ли возможность разделить результат на два div блока? На данный момент я возвращаю два значения в один блок.
Вот сам код:
function showPrice()
{
citys_to=document.getElementById("citys_to").value;
men=document.getElementById("men").value;
from_citys=document.getElementById("from_citys").value;
property_type=document.getElementById("property_type").value;
if(citys_to=="5" || from_citys=="5"){
var delay_popup = 5;
setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
$('#price')[0].reset();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
//document.getElementById("txtHours").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","../../wp-content/plugins/calculator_truck/calculator_truck.php?reset=1",true);
xmlhttp.send();
return
}
if(property_type=="8"){
var delay_popup = 5;
setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
$('#price')[0].reset();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
//document.getElementById("txtHours").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","../../wp-content/plugins/calculator_truck/calculator_truck.php?reset=1",true);
xmlhttp.send();
return
}
if (citys_to==""||men=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
//document.getElementById("txtHours").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","../../wp-content/plugins/calculator_truck/calculator_truck.php?citys_to="+citys_to+"&men="+men+"&property_type="+property_type+"&from_citys="+from_citys,true);
xmlhttp.send();
}
<div id="txtHint"></div>